#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <string.h>

pthread_t ntid;

void *thr_fn(void *arg) {
	
	for(;1;){printf("hello here!\n");}
	return ((void *) 0);
}

int main(){
	int err,skt;
	struct sockaddr_in servaddr;
	struct sockaddr_in clientaddr;
	socklen_t sktlen=sizeof(clientaddr);
	//err = pthread_create(&ntid, NULL, thr_fn, NULL);
	//printf("%s","hello thread!\n");
	
	memset(&servaddr, 0, sizeof(servaddr));
    servaddr.sin_family = AF_INET;
    servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
    servaddr.sin_port = htons(80);
	skt=socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
	bind(skt, (struct sockaddr*)&servaddr, sizeof(servaddr));
	listen(skt, 10);

	for(;1;){
		accept(skt,(struct sockaddr*)&clientaddr,&sktlen);
	}
	
	
	return 0;
}
